<?php

namespace app\mall\controller\api\uc;

use app\mall\controller\admin\MallUser;
use app\mall\enum\StatusEnum;
use app\mall\exceptions\ApiException;
use app\mall\model\MallGoods;

class Base extends \app\mall\controller\api\Base
{

    protected function getUid()
    {
        return $this->request->get('__UID__');
    }

    /**
     * @var MallUser
     */
    protected $mallUser;
    protected function getMallUser()
    {
        $uid = $this->getUid();
        $this->mallUser = MallUser::find($uid);
        if (!$this->mallUser){
            ApiException::throws(ApiException::$needLogin);
        }
        if (!$this->mallUser->enableEnum->isYes()){
            ApiException::throws(ApiException::$userLocked);
        }
        return $this->mallUser;
    }
}